package Demo01.Map;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Demo03EntrySet {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        map.put("赵丽颖",168);
        map.put("杨颖",165);
        map.put("林志玲",178);

        Set<Map.Entry<String, Integer>> set = map.entrySet();

        Iterator<Map.Entry<String, Integer>> it = set.iterator();

        while(it.hasNext()){
            Map.Entry<String, Integer> entry = it.next();

            String key = entry.getKey();
            Integer value = entry.getValue();
            System.out.println(key + "=" + value);

            System.out.println("=============");

            for(Map.Entry<String, Integer> entry1 : set){
                String key1 = entry1.getKey();
                Integer value1 = entry1.getValue();
                System.out.println(key1 + "=" + value1);
            }

        }

    }
}
